{include file="public/header"}
    <style type="text/css">
    	#wrapper {
            width: 100%;
            position: absolute;
            left: 0;
            top:85px;
            overflow: hidden;
            z-index: 1;
            /* 防止本机Windows上的触摸事件 */
            -ms-touch-action: none;
            /* 防止callout tap-hold和文本的选择 */
            -webkit-touch-callout: none;
            -webkit-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
            user-select: none;
            /* 防止文本调整取向变化对web应用程序很有用 */
            -webkit-text-size-adjust: none;
            -moz-text-size-adjust: none;
            -ms-text-size-adjust: none;
            -o-text-size-adjust: none;
            text-size-adjust: none;
        }
        .pull-loading {
            text-align: center;
            height: 40px;
            line-height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
			color: #fff;
        }
        #scroller ul li {}
    </style>
<body class="she_body">
<div class="bg_fixed_v10_1"></div>
	<div class="sectionY sectionY_tttt">
		<a href="{:url('User/index')}">
			<img src="__PUBLIC__/home/images/v10_a9.png" alt="" class="a1">
		</a>
<!--		<p class="p1">我的团队({$totalteam})</p>-->
		<p class="p1">
			<span class="ppp_title">我的团队</span>
		</p>
	</div>
	<div class="kong1"></div>
	<div class="zu_section1 team_1 clearfix">
		<ul class="firend_li">
			<li {if condition="$types eq 1"} class='select' {/if}>
				<a href="{:url('User/teamlist',['types'=>1])}">直推好友</a>
			</li>
			<li {if condition="$types eq 2"} class='select' {/if} >
				<a href="{:url('User/teamlist',['types'=>2])}">二级好友</a>
			</li>
		</ul>
	</div>
	<div class="team_section1" >
		<!-- 直推好友 -->
		<div class="team_big" id='wrapper'>
            <div id="scroller" >
                <div class="ttrr">
	                {foreach name='userlist' item='v'}
	                    <div class="f1 clearfix">
            				<div class="logo_1">
            					<img src="__PUBLIC__/home/images/a26.png" alt="">
            				</div>
            				<div class="name">
            					<p class="p1">{$v.username}</p>
            					<p class="p2">

                                    {if condition="$v['user_status'] eq 0"}<span style='color:#000;'>未转账激活</span>{/if}
                                    {if condition="$v['user_status'] eq 1"}已转账激活{/if}
                                </p>
            				</div>
            				<div class="last">
            					<span class="s1">{$v.nextcount}</span>
            				</div>
            			</div>
	                {/foreach}
                </div>
                <div class="pull-loading">上拉加载</div>
            </div>

		</div>
	</div>
</body>
<script type="text/javascript">
    $(function(){
        var dd = $("#wrapper").offset().top;
        $("#wrapper").css("height",($(window).height()-dd-50));
        $("#wrapper").css("top",dd);
    })
</script>
<script>
	$(function(){
		var d = $(window).height()-46-60;
		$(".zu_section2").css("height",d);
	})

    var myscroll = new iScroll("wrapper", {
        onScrollMove: function () { //拉动时
            //上拉加载
            if (this.y < this.maxScrollY) {
                $(".pull-loading").html("释放加载");
                $(".pull-loading").addClass("loading");
            } else {
                $(".pull-loading").html("上拉加载");
                $(".pull-loading").removeClass("loading");
            }
        },
        onScrollEnd: function () { //拉动结束时
            //上拉加载
            if ($(".pull-loading").hasClass('loading')) {
                $(".pull-loading").html("加载中...");
                pullOnLoad();
            }
        }
    });
    //上拉加载函数,ajax
    var num = 1;
    function pullOnLoad() {
        num++;
        $.ajax({
            type:'post',
            url:"{:url('User/ajaxmoreteams')}?types={$types}",
            data:{page:num},
            cache:false,
            dataType:'JSON',
            success:function(data){
                if(data.length<=0){
                    $('.pull-loading').html("已加载全部");
                }else{
                    var html = '';
                    for(var i=0;i<data.length;i++){
                        html += '<div class="f1 clearfix">';
                        html += '   <div class="logo_1">';
                        html += '       <img src="__PUBLIC__/home/images/a26.png" alt="">';
                        html += '   </div>';
                        html += '<div class="name">';
                        html += '   <p class="p1">'+data[i]['username']+'</p>';
                        html += '       <p class="p2">';
                        //html += '   ID：'+data[i]['id']+'(';
                        if(data[i]['user_status']==0){
                            html += '<span style="color:#000;">未转账激活</span>';
                        }
                        if(data[i]['user_status']==1){
                            html += '已转账激活';
                        }
                        html += '</p></div>';
                        html += '<div class="last">';
                        html += '<span class="s1">'+data[i]['nextcount']+'</span>';
                        html += '</div></div>';

                    }
                    $("#scroller .ttrr").append(html);

                    $('.pull-loading').html("上拉加载");
                }
				myscroll.refresh();
            }
        });
    }
    pullOnLoad();
</script>
</html>
